#ifndef PORTSTRUCT_H
#define PORTSTRUCT_H

#include <QObject>
#include <QMetaType>
#include "DataType.h"
#include <QDebug>

class PortStruct
{
public:
    PortStruct();

    QString type() const;
    void setType(const QString &type);

    QString name() const;
    void setName(const QString &name);

    QString ip() const;
    void setIp(const QString &ip);

    quint16 port() const;
    void setPort(const quint16 &port);

    QString portName() const;
    void setPortName(const QString &portName);

    QString mode() const;
    void setMode(const QString &mode);

    QString baudRate() const;
    void setBaudRate(const QString &baudRate);

    QString dataBits() const;
    void setDataBits(const QString &dataBits);

    QString parity() const;
    void setParity(const QString &parity);

    QString stopBits() const;
    void setStopBits(const QString &stopBits);

    QString flowControl() const;
    void setFlowControl(const QString &flowControl);

    QString enablePinNumber() const;
    void setEnablePinNumber(const QString &enablePinNumber);

    bool operator ==(const PortStruct& rhs);  //重载相等

private:
    QString m_type;
    QString m_name;

    QString m_ip;
    quint16 m_port;

    QString m_portName;
    QString m_mode;
    QString m_baudRate;
    QString m_dataBits;
    QString m_parity;
    QString m_stopBits;
    QString m_flowControl;
    QString m_enablePinNumber;
};

QDebug operator <<(QDebug debug, const PortStruct &port);

Q_DECLARE_METATYPE(PortStruct)

#endif // PORTTYPE_H
